using Godot;
using System;

public partial class control : Sprite2D
{
	// Called when the node enters the scene tree for the first time.
	public override void _Ready()
	{
		// CanvasItem常用属性
		// 是否显示
		this.Visible = true;
		// 渲染顺序
		this.ZIndex = 10;
		this.ZAsRelative = false; // 渲染的顺序是否基于ZIndex，会包含父节点的值

		// Node2D 常用属性
		// 位置
		this.Position = new Vector2(500, 300);
		// 旋转
		// this.Rotation = 0.1f; // 弧度
		// this.RotationDegrees = 30;  // 角度
		// 缩放
		this.Scale = new Vector2(2, 2);
		// 倾斜
		// this.Skew = 30;
	}

	// Called every frame. 'delta' is the elapsed time since the previous frame.
	public override void _Process(double delta)
	{
		// 获取鼠标位置
		var mousePos = GetGlobalMousePosition();
		// GD.Print(mousePos);

		// 看向某个点
		LookAt(mousePos);
	}
}
